package android.support.v4.os;


/**
 * 
 * @author yichou 2015-3-18
 *
 */
public class EApplicationPackageManager extends EHook {

	@Override
	public String getClassName() {
		return "android.app.ApplicationPackageManager";
	}
	
	@Override
	public void hook() {
		super.hook();

		//List<PackageInfo> getInstalledPackages(int flags)
		findAndHookMethod("getInstalledPackages", int.class, this);
		//List<ApplicationInfo> getInstalledApplications(int flags)
		findAndHookMethod("getInstalledApplications", int.class, this);
		//ApplicationInfo getApplicationInfo(String packageName, int flags)
		findAndHookMethod("getApplicationInfo", String.class, int.class, this);
		//PackageInfo getPackageInfo(String packageName, int flags)
		findAndHookMethod("getPackageInfo", String.class, int.class, this);
	}

	@Override
	protected void after(String name, Object[] args, MethodHookParam param) {
		log.i("ApplicationPackageManager", name + " " + args[0]);
	}
}
